﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>李宁体育管理系统</title>

    <link rel="shortcut icon" href="favicon.ico">
    <link href="<%=path%>/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="<%=path%>/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="<%=path%>/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="<%=path%>/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="<%=path%>/css/plugins/chosen/chosen.css" rel="stylesheet">

    <link href="<%=path%>/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="<%=path%>/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="<%=path%>/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
          rel="stylesheet">
    <link href="<%=path%>/css/animate.min.css" rel="stylesheet">
    <link href="<%=path%>/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" action="./toUpdateAccount" method="post" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户名：</label>
									<input id="id" name="id"  type="hidden" value="${user.id }">
                            <div class="col-sm-4">
                                <input id="userName" name="userName" class="form-control" type="text" value="${user.userName }" maxlength="32" placeholder="这里输入用户名" title="用户名">
                            </div>
                        </div>
                       
                        <div class="form-group">
                            <label class="col-sm-2 control-label">身份：</label>
                            <div class="col-sm-4">
								<select class="chosen-select form-control" name="roleCode" id="roleCode" data-placeholder="请选择身份" >
									<option value="">请选择身份</option>
                                    <option value="1" <c:if test="${1 ==user.roleCode}">selected</c:if>>普通管理员</option>
                                    <option value="2" <c:if test="${2 ==user.roleCode}">selected</c:if>>超级管理员</option>
                            </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">真实姓名：</label>

                            <div class="col-sm-4">
                                <input id="realName" name="realName" class="form-control"  value="${user.realName }"  maxlength="32" placeholder="输入真实姓名" title="真实姓名">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号：</label>

                            <div class="col-sm-4">
                                <input id="mobile" name="mobile" class="form-control" type="number" value="${user.mobile }"   maxlength="11" placeholder="这里输入手机号" title="手机号">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">邮箱：</label>

                            <div class="col-sm-4">
                                <input id="email" name="email" class="form-control" type="email" value="${user.email }"  maxlength="64" placeholder="这里输入邮箱" title="邮箱">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">品牌：</label>

                            <div class="col-sm-4">
                                   <select class="chosen-select form-control" name="mpId" id="mpId" data-placeholder="请选择品牌" >
                                <option value=""></option>
                                <c:forEach items="${list }" var="mp">
                                    <option value="${mp.id }" <c:if test="${mp.id ==user.mpId}">selected</c:if>>${mp.nickName }</option>
                                </c:forEach>
                            </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                                &nbsp;<button class="btn btn-info" type="button" onclick="goback()">返回</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<%=path%>/js/jquery.min.js?v=2.1.4"></script>
<script src="<%=path%>/js/bootstrapValidator.min.js"></script>
<!--下拉框-->
<script src="<%=path%>/js/plugins/chosen/chosen.jquery.js"></script>

<script>
var config = {
        ".chosen-select": {},
        ".chosen-select-deselect": {allow_single_deselect: !0},
        ".chosen-select-no-single": {disable_search_threshold: 10},
        ".chosen-select-no-results": {no_results_text: "Oops, nothing found!"},
        ".chosen-select-width": {width: "95%"}
    };
for (var selector in config)$(selector).chosen(config[selector]);
    $(document).ready(function () {
        $('#signupForm').bootstrapValidator({
            message: 'This value is not valid',
            fields: {
                userName: {
                    message: '用户名不能为空！',
                    validators: {
                        notEmpty: {
                            message: '用户名不能为空！'
                        }
                    }
                },
                mobile: {
                    message: '手机号不能为空！',
                    validators: {
                        notEmpty: {
                            message: '手机号不能为空！'
                        }
                    }
                },
                email: {
                    validators: {
                        notEmpty: {
                            message: '邮箱不能为空！'
                        }

                    }
                }
            },
            submitHandler: function(validator, form, submitButton) {
            }
        });
    });
    
    
    function goback() {
		window.location.href="<%=path%>/manager/listAccount";
	}
</script>
</body>
</html>
